﻿var mygrid = {
    bindGrid: function (size) {
        $('#mGrid').datagrid({
            toolbar: '#toolbar',
            title: '包投标商列表',
            iconCls: 'icon icon-list',
            width: size.width,
            height: size.height,
            nowrap: false,
            rownumbers: true,
            animate: true,
            url: actionUrl,
            queryParams: {
                action: 'queryall',
                filter: JSON.stringify(filterObj)
            },
            columns: [[
				//{ title: '投标商', field: 'KeyId', width: 100 },
				{ title: '名称', field: 'bname', width: 100 },
                { title: '投标商编号', field: 'bbh', width: 100 },
                {
                    title: '上传方案', field: 'u', width: 100, formatter: function (v, d, i) {

                        return '<a href="#" onclick="crud.addz(' + d.KeyId + ',\'' + d.bagbh + d.bagid + '\');">上传方案</a>';

                    }
                },
				{ title: '手机', field: 'bphone', width: 100 },
				{ title: '股东名单', field: 'bshareholders', width: 100 },
				{ title: '固定电话', field: 'btel', width: 100 },
				{ title: '邮箱', field: 'bemail', width: 100 },
				{ title: '代理人编号', field: 'abh', width: 100 },
                { title: '代理人', field: 'aname', width: 100 },
                { title: '项目经理编号', field: 'mbh', width: 100 },
                { title: '项目经理', field: 'mname', width: 100 },
                { title: '包编号', field: 'bagbh', width: 100 },
                { title: '包名', field: 'bagname', width: 100 }


            ]]
        });
    },
    reload: function () {

        $('#mGrid').datagrid('clearSelections').datagrid({ queryParams: { action: 'queryall', filter: JSON.stringify(filterObj) } });
    },
    selectRow: function () {
        return $('#mGrid').datagrid('getSelected');
    },
    getids: function () {
        var rows = $('#mGrid').datagrid('getSelections');
        if (rows == null || rows.length == 0) {
            $.messager.alert("提示", "请选择要设置的行！", "info");
            return;
        }
        ids = "";
        for (var i = 0; i < rows.length; i++)
            ids = ids + rows[i].KeyId + ",";
        if (ids != "")
            ids = ids.substr(0, ids.length - 1);
    }
}
